﻿using UnityEngine;
using System.Collections;

public class PlatformManager : MonoBehaviour {

    public CameraController cameraScript;

    private int lastSize = 0;
	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
	    if(lastSize != PlatformBehaviour.visiblePlatform.Count)
        {
            updatePlatformColliders(cameraScript.getOrientation());
        }
	}

    public void updatePlatformColliders(Vector3 orientation)
    {
        foreach (PlatformBehaviour obj in PlatformBehaviour.visiblePlatform)
        {
            obj.SendMessage("updateCollider", orientation);
        }
    }
}
